package com.situ.ymall.controller.api;

import com.situ.ymall.service.GoodsSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 获取商品分类信息的接口
 */
@RestController
@RequestMapping("/api/goodsSort")
public class APIGoodsSortController {
    @Autowired
    private GoodsSortService goodsSortService;
    /**
     * 获取一级分类
     */
    @GetMapping("/getParent")
    public List getParent(){
        // 1. 获取参数
        // 2. 调用service
        List list = goodsSortService.getParent();
        // 3. 返回数据
        return list;
    }
}
